<?php namespace system\database\migrations;
use houdunwang\database\build\Migration;
use houdunwang\database\build\Blueprint;
use houdunwang\database\Schema;

/** 文章管理表
 * Class CreateArticleTable
 * @package system\database\migrations
 */
class CreateArticleTable extends Migration {
    //执行
	public function up() {
		Schema::create( 'article', function ( Blueprint $table ) {
			$table->increments( 'arc_id' );
            $table->timestamps();
            $table->string('arc_title',100)->defaults('')->comment('文章标题');
            $table->tinyInteger('arc_click')->unsigned()->defaults(0)->comment('点击次数');
            $table->text('arc_content')->defaults('')->comment('文章内容');
            $table->string('arc_description',100)->defaults('')->comment('文章描述');
            $table->string('arc_author',50)->defaults('')->comment('文章作者');
            $table->string('arc_linkurl',40)->defaults('')->comment('文章外部链接');
            $table->string('arc_source',40)->defaults('')->comment('文章来源');
            $table->string('arc_ishot',25)->defaults('')->comment('是否热门');
            $table->string('arc_recommend',25)->defaults('')->comment('是否推荐');
            $table->tinyInteger('arc_sort')->unsigned()->defaults(0)->comment('文章排序');
            $table->tinyInteger('cate_id')->unsigned()->defaults(0)->comment('栏目主键');
            $table->string('arc_keyword',200)->defaults('')->comment('微信关键词');


        });
    }

    //回滚
    public function down() {
        Schema::drop( 'article' );
    }
}